package com.ysd.lis.service.eq.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.ysd.common.Result;
import com.ysd.lis.entity.eq.EqRepairRecord;
import com.ysd.lis.mapper.eq.EqRepairRecordMapper;
import com.ysd.lis.request.eq.EqMaintainParam;
import com.ysd.lis.service.eq.EqRepairRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 设备管理-设备类型 服务实现类
 * </p>
 *
 * @author prs
 * @since 2024-08-22
 */
@Service
public class EqRepairRecordServiceImpl extends ServiceImpl<EqRepairRecordMapper, EqRepairRecord> implements EqRepairRecordService {

    @Autowired
    EqRepairRecordMapper eqRepairRecordMapper;
    @Override
    public Result findRepairRecordList(EqMaintainParam param) {
        MPJLambdaWrapper<EqRepairRecord> queryTableWrapper1 = new MPJLambdaWrapper<>();
        queryTableWrapper1.selectAll(EqRepairRecord.class)
                .eq(EqRepairRecord::getRepairId,param.getRepairId())
                .eq(EqRepairRecord::getDelFlag,0)
                .orderByDesc(EqRepairRecord::getCreateTime);
        List<EqRepairRecord> detailList = eqRepairRecordMapper.selectList(queryTableWrapper1);
        return Result.succ(1, "查询成功", detailList);
    }
}
